package com.tenton.service.Impl;

import com.tenton.mapper.CityMapper;
import com.tenton.pojo.City;
import com.tenton.pojo.Province;
import com.tenton.service.CityService;
import com.tenton.utils.MybatisUtils;
import org.apache.ibatis.session.SqlSession;

import java.util.List;

/**
 * @Date: 2021/1/14
 * @Author: Tenton
 * @Description:
 */
public class CityServiceImpl implements CityService {
    /**
     * 查询所有城市
     * @param provinceCode
     * @return
     */
    @Override
    public List<City> listCityByProvinceCode(String provinceCode) {
        SqlSession sqlSession = MybatisUtils.getSqlSession();
        CityMapper mapper = sqlSession.getMapper(CityMapper.class);
        List<City> cities = mapper.listCityByProvinceCode(provinceCode);
        return cities;
    }
}
